<!--#include file="system32.asp"-->
<%
Call CheckOutPost()
Response.AddHeader"pragma","no-cache" 
Response.AddHeader"cache-control","no-store" 
Call LoadBaseCommentApp(lcase(session("GetCode")))
Function LoadBaseCommentApp(sId)
	Session.Contents.Remove("GetCode")
	if (Request.ServerVariables("REQUEST_METHOD") = "POST") Then 
	'response.write("开始处理评论...")
	Dim lastUrl
	lastUrl =Cstr(Request.ServerVariables("HTTP_REFERER")) 
		if lcase(trim(request("code")))= sId  then 
			'Session.Contents.Remove("GetCode")
			Dim iid,uname,ucontent,oInfo
			
			iid = killint(request("iid"),0,0,10)
			Set oInfo = new Info
			oInfo.PInfoMdb	= ConstDBtablearr(1)
			If(Not oInfo.ExistID(iid)) Then 
				response.write("无效的来源信息编号ID")
				response.write (CoutError(6,lastUrl))
				response.End()
				Exit Function 
			End If 

			if CheckCanRead(1,iid,ReadLockYes) <> true then 
				response.write("加密内容")
				response.write (CoutError(6,lastUrl))
				response.End()
				exit Function 
			End if 
			uname  =Trim(request("name"))
			ucontent  =request("context")
			if len(uname)< 1 Or len(uname)> 20   then 
				response.write ("用户名请控制在1-20个字符之间")
				response.write (CoutError(6,lastUrl))
				response.End()
				exit Function 
			End if
			if len(ucontent)< 1  then 
				response.write ("评论不能太短哦")
				response.write (CoutError(6,lastUrl))
				response.End()
				exit Function 
			End If
			AddReply(Array(0,iid,uname,GetIp(),bbcode(ucontent)))
			oInfo.CreateXmlFile(iid) '创建XML文件
			If(NeedHtmlPage) Then 
			Call LoadTplConfig(server.mappath("../") & "\")
			'更新页面
			Call CreateInfomationItemHtml( iid ,false)	
			'更新首页
			Call CreateCemplateHtml( Tpl.GetValue("BasePath") & TemplateBasePath & "\default.asp" ,false)
			'更新栏目页面
				Dim iPosParentIDs,iPosChildIDs,iPosCIDs,cat_id
				cat_id=oInfo.GetCatalogueID(iid)
				iPosChildIDs = GetWithChildsInIDs( cat_id )
				Dim newCArrays,cIDIns
				newCArrays=Split(Replace(Replace(iPosChildIDs,")",""),"(",""),",")
				For each cIDIns In newCArrays
					If(IsInteger(cIDIns)) Then 
						Call Tpl.Assign("SectedID",cIDIns)
						Call CreateCemplateHtml( Tpl.GetValue("BasePath") & TemplateBasePath & "\dir-index.asp",false )
					End If 
				Next
			End If 
			response.write("发表成功，3秒后返回")
			response.write (CoutError(6, IIF(NeedHtmlPage,BaseURI & Replace(oInfo.GetFullPath(iid),"\","/"),BaseURI & "item.asp?id="& iid) & "#" & oInfo.GetLastReplyID(GetIp())))
			exit Function 
		Else 
			response.write("验证码验证无效,请返回")
			response.write (CoutError(6,lastUrl))
			Exit Function 
		End If 
	End If 
End Function 
%>